#include "deviceitem.h"
#include "ui_deviceitem.h"

DeviceItem::DeviceItem(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DeviceItem)
{
    ui->setupUi(this);
}

DeviceItem::~DeviceItem()
{
    delete ui;
}

//设置显示图片
void DeviceItem::setIcon(QPixmap map)
{
    map.scaled(ui->label->width(),ui->label->height());
    ui->label->setScaledContents(true);

//    label->setPixmap(QPixmap(":/new/prefix1/resource/1.png").scaled(25,25));
    ui->label->setPixmap(map);
    ui->label->setAlignment(Qt::AlignCenter);//图片居中显示
}
